/**
 * 
 */
package com.arx.graphics.flyweight;


/**
 * @author Donald
 */
public class ANIM_USE {
	private short		altidx_cur;	// idx to alternate anims...
	private short		altidx_next;	// idx to alternate anims...
	private long		ctime;
	private ANIM_HANDLE	cur_anim;
	private long		flags;
	private long		fr;
	private long		lastframe;
	private ANIM_HANDLE	next_anim;
	private long		nextflags;
	private float		pour;
	/**
	 * Assigns a specific flag, if it wasn't already set.
	 * @param flag the flag to be set
	 */
	public void assignFlag(final int flag) {
		flags |= flag;
	}
	/**
	 * Assigns a specific next flag, if it wasn't already set.
	 * @param flag the flag to be set
	 */
	public void assignNextflag(final int flag) {
		nextflags |= flag;
	}
	/** Clears all flags. */
	public void clearFlags() {
		flags = 0;
	}
	/** Clears all next flags. */
	public void clearNextflags() {
		nextflags = 0;
	}
	public short getAltidx_cur() {
		return altidx_cur;
	}
	public short getAltidx_next() {
		return altidx_next;
	}
	public long getCtime() {
		return ctime;
	}
	/**
	 * Gets the cur_anim
	 * @return {@link ANIM_HANDLE}
	 */
	public ANIM_HANDLE getCur_anim() {
		return cur_anim;
	}
	public long getLastframe() {
		return lastframe;
	}
	/**
	 * Gets the next_anim
	 * @return {@link ANIM_HANDLE}
	 */
	public ANIM_HANDLE getNext_anim() {
		return next_anim;
	}
	/**
	 * Determines if the {@link ANIM_USE} has a specific flag set.
	 * @param flag the flag
	 * @return true if the object has the flag set; false otherwise
	 */
	public boolean hasFlag(final int flag) {
		return (flags & flag) == flag;
	}
	/**
	 * Removes a specific flag if it was set.
	 * @param flag the flag to be removed
	 */
	public void removeFlag(final int flag) {
		flags &= ~flag;
	}
	/**
	 * Removes a specific next flag if it was set.
	 * @param flag the flag to be removed
	 */
	public void removeNextflag(final int flag) {
		nextflags &= ~flag;
	}
	public void setAltidx_cur(final short altidx_cur) {
		this.altidx_cur = altidx_cur;
	}
	public void setAltidx_next(final short altidx_next) {
		this.altidx_next = altidx_next;
	}
	public void setCtime(final long ctime) {
		this.ctime = ctime;
	}
	/**
	 * Sets the cur_anim
	 * @param cur_anim the cur_anim to set
	 */
	public void setCur_anim(final ANIM_HANDLE cur_anim) {
		this.cur_anim = cur_anim;
	}
	public void setLastframe(final long lastframe) {
		this.lastframe = lastframe;
	}
	/**
	 * Sets the next_anim
	 * @param next_anim the next_anim to set
	 */
	public void setNext_anim(final ANIM_HANDLE next_anim) {
		this.next_anim = next_anim;
	}
}
